![]() |
DoIdentifyFileProcPtr |
||||
Header: | TranslationExtensions.h | Carbon status: | Unsupported | |
Defines a pointer to a file identification callback function. Your file identification callback function identifies a file as having a format which your extension can translate.
typedef ComponentResult(* DoIdentifyFileProcPtr) ( ComponentInstance self, const FSSpec *theDocument, FileType *docType );
You would declare your function like this if you were to name it MyDoIdentifyFileCallback:
ComponentResult MyDoIdentifyFileCallback ( ComponentInstance self, const FSSpec *theDocument, FileType *docType );
A component instance that identifies the component containing the translation extension.
A pointer to a file system specification structure that specifies the document that the translation extension must identify.
Your function should return, in this parameter, the file format type of the file specified in the theDocument parameter.
Your function should not return 'TEXT' as a file type unless you determine that the document consists solely of a plain, unformatted stream of ASCII characters.
If successful, your function should return noErr. Otherwise, your function should return an appropriate result code. If your translation extension does not recognize the type of the specified file, your function should return the result code noTypeErr. The Component Manager requires this function to return a value of type ComponentResult to simplify dispatching.
A file translation extension must respond to the kTranslateIdentifyFile request code. The Translation Manager uses this request code to allow the translation extension to identify a file as having a format that the extension can translate. You can handle this request by calling the Component Manager function CallComponentFunctionWithStorage and passing it a pointer to your file identification callback function.
The functions contained in TranslationExtensions.h were originally written to be used only by someone implementing a Mac Easy Open translation component. Carbon, however, is for applications and not extensions. Therefore, this function is not supported.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)